#ifndef TERRAIN_H
#define TERRAIN_H

#include "D3DApp.h"
#include "GameObject.h"
#include "dxut/DXUT.h"
#include "Fractal.h"

class Terrain : public GameObject
{
public:

	void Create(int size, float cellsize, D3DXVECTOR3 pos);
	void Create();
	int GetCellSize();
	int GetAbsSize(){return m_Size*m_CellSize;}
	int GetNumCells(){return m_Size;}
	Fractal* GetFractal();
	float GetHeightAtPoint(D3DXVECTOR2 point);

private:
	int m_Size;
	float m_CellSize;
	int m_NumVerts;
	int m_NumCells;
	int m_NumTris;
	bool m_bTile;
	LPDIRECT3DINDEXBUFFER9 m_Ib;
	LPDIRECT3DVERTEXBUFFER9 m_Vb;
	Fractal m_Fractal;
	std::vector<D3DXVECTOR3> m_vTriNorms;
};
#endif